<form role="form" action="<?= site_url($this->uri->uri_string()) ?>" id="form_mantenimiento" enctype="multipart/form-data">
    <input type="hidden" value="<?= $current ? $current['men_id'] : '' ?>" name="men_id" id="men_id">
    <div class="form-group">
        <label for="men_slug">Slug</label>
        <input type="text" value="<?= $current ? $current['men_slug'] : '' ?>" class="form-control" name="men_slug" id="men_slug">
    </div>
    <div class="form-group">
        <label for="men_desc">Descripcion</label>
        <input type="text" value="<?= $current ? $current['men_desc'] : '' ?>" class="form-control" name="men_desc" id="men_desc">
    </div>
    <div class="form-group">
        <label for="men_parent">Opcion padre</label>
        <select class="form-control" name="men_parent" id="men_parent">
            <option></option>
            <?php foreach ($infomenu as $menu) { ?>
                <option value="<?=$menu['men_id']?>" <?= $current['men_parent'] == $menu['men_id'] ? 'selected' : '' ?>><?= ulang($menu['men_slug']) ?></option>
            <?php } ?>
        </select>
    </div>
    <div class="form-group">
        <label for="men_roles">Roles que pueden acceder</label>
        <select multiple="multiple" class="multi-select" id="select-roles" name="men_roles[]">
            <?php 
            foreach ($roles as $rol) {
                $selected = "";
                foreach($roles_menu as $rol_menu){
                    if($rol_menu['bmr_fk_rol'] == $rol['rol_id']){
                        $selected = "selected";
                    }
                }
                echo '<option value="'.$rol['rol_id'].'" '.$selected.'>'.$rol['rol_slug'].'</option>';
            } 
            ?>
        </select>
    </div>
    <div class="form-group">
        <label for="men_seccion">Seccion</label>
        <input type="text" value="<?= $current ? $current['men_seccion'] : '' ?>" class="form-control" name="men_seccion" id="men_seccion">
    </div>
    <div class="form-group">
        <label for="men_orden">Orden</label>
        <input type="text" value="<?= $current ? $current['men_orden'] : '' ?>" class="form-control" name="men_orden" id="men_orden">
    </div>
    <div class="form-group">
        <label for="men_icono">Icono</label>
        <input type="text" value="<?= $current ? $current['men_icono'] : '' ?>" class="form-control" name="men_icono" id="men_icono">
    </div>
    <div class="form-group">
        <label for="men_enlace">Enlace</label>
        <input type="text" value="<?= $current ? $current['men_enlace'] : '' ?>" class="form-control" name="men_enlace" id="men_enlace">
    </div>
    <div class="form-group">
        <label for="men_isenlace">Es un enlace / Solo abre un submenu</label>
        <div class="radio-list">
            <label class="radio-inline">
                <input type="radio" name="men_isenlace" value="S" <?= $current ? $current['men_isenlace'] == 'S' ? 'checked' : '' : '' ?>> Si
            </label>
            <label class="radio-inline">
                <input type="radio" name="men_isenlace" value="N" <?= $current ? $current['men_isenlace'] == 'N' ? 'checked' : '' : '' ?>> No
            </label>
        </div>
    </div>
</form>
